/* eslint-disable no-underscore-dangle */
import { message } from 'choerodon-ui/pro';

export const handleCopyOk = () => {
  message.success('复制成功');
};

export const getTriggerAddress = (projectId:string) => `${(window as any)._env_.API_HOST}/devops/v1/projects/${projectId}/pipelines/execute_by_token`;

export const getcurlText = (token:string, personalToken:string, projectId:string) => {
  const curlText = `curl -X POST \\
    --fail \\
    -F "token=${token}" \\
    -F "personal_token=${personalToken}" \\
    ${getTriggerAddress(projectId)}`;
  return curlText;
};
